package com.qianya.system.feign;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qianya.model.common.CommonResult;
import com.qianya.model.pojo.login.qo.LoginUsersQO;
import com.qianya.model.pojo.login.vo.LoginRoleVO;
import com.qianya.model.pojo.login.vo.LoginUsersVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @author xiaomianyang
 * @description
 * @date 2019-07-20 15:26
 */
@FeignClient(name="system-manage")
@Component
public interface SystemManageFeign {
    @RequestMapping(value = "/sys/sys-set-admin-ip/find",method = RequestMethod.GET)
    CommonResult find();

    /**
     * 查找用户
     */
    @GetMapping("/login/login-users/find")
    CommonResult<IPage<LoginUsersVO>> find(@RequestBody LoginUsersQO loginUsersQO);

    /**
     * 通过用户id查找角色权限
     *
     * @param userId
     * @return
     */
    @GetMapping("/login/login-role/findRoleByUserId")
    CommonResult<List<LoginRoleVO>> findRoleByUserId (String userId);
}
